The present invention relates to computer systems. In particular, the invention relates to a novel approach for implementing computer systems which include software libraries which are dynamically optimized for the particular hardware and/or architecture on which they are running.
When certain types of libraries of computer software are implemented, consideration is often given to optimizing various modules whose performance has a significant impact on the operation of the system which is to use the library. Optimization techniques heretofore known generally take into account the particular hardware or architecture on which the software is expected to run. Unfortunately, as changes are made to computer hardware, software libraries which were optimized for one hardware configuration or architecture are no longer optimized for the new hardware configuration. Alternatively, if a software library is developed with the knowledge that it is to be used on a number of different systems, it can be configured to have either generic modules which will work with any processor or computer architecture, or it may have a single, complicated module which can handle any condition which is expected to be encountered.
A problem with generic modules is that they cannot be optimized for each individual processor configuration, and a problem with the more complicated modules is that in order for them to be able to handle the specific conditions which they encounter they must contain numerous conditional checks, which themselves, slow down the overall system performance each time the module runs. Another problem with the single, complicated module approach is that in some cases such modules are not even technically possible. For instance, compiled (non-assembly) code must be targeted for a particular machine architecture, and it is not possible to get the compiler to generate mixed architecture modules.
Accordingly, in order to optimize software libraries without the problem of having a complicated module with numerous conditional checks, one approach which has been used heretofore was to provide both generic modules, which would work with any processor or architecture under all conditions, and to provide higher performance modules which would only work under certain, specific conditions.
Notwithstanding the higher performance achieved by the latter approach, it only improves system performance under those specific conditions contemplated by the high performance modules. It does not optimize the overall performance of the system for specific processors or architectures.